package com.framework.modules.live.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.Query;

import com.framework.modules.live.dao.LiveVideoDao;
import com.framework.modules.live.entity.LiveVideoEntity;
import com.framework.modules.live.service.LiveVideoService;


@Service("liveVideoService")
public class LiveVideoServiceImpl extends ServiceImpl<LiveVideoDao, LiveVideoEntity> implements LiveVideoService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<LiveVideoEntity> page = this.selectPage(
                new Query<LiveVideoEntity>(params).getPage(),
                new EntityWrapper<LiveVideoEntity>()
                .eq(params.containsKey("stream_id"),"stream_id",params.getOrDefault("stream_id","0"))
        );

        return new PageUtils(page);
    }

}
